const { mysql } = require('../qcloud')


module.exports = async (ctx, next) => {
  var bName = ctx.request.url.split('?')[1].split('=')[1];
  await mysql('book').select('*').where({ book_url: bName }).then(res => {
    ctx.state.data = res;
  })
}








  // var bName = ctx.request;
  // await mysql('book').select('*').where({ bookName : bName}).then(res => {
  //   ctx.state.data = res;
  // })


  // await mysql('book').select('*').where({bookName:'计算机网络'}).then(res => {
  //   ctx.state.data = res;
  // })
  //var bName = ctx.request.url.split('?')[1].split('=')[1];
